﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.IM;
using yunbo.Model.SM;
using yunbo.Repositorys.IMRepositorys;
using yunbo.Repositorys.SMRepositorys;

namespace yunbo.Controllers.IMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_CKPDController : ControllerBase
    {
        WMS_CKPDRepository wMS_CKPDRepository=new WMS_CKPDRepository();
        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        [HttpPost("PostWMS_CKPD")]
        public IActionResult PostWMS_CKPD(TJWMS_CKPD wMS_CKPD)
        {
            bool rs = wMS_CKPDRepository.PostWMS_CKPD(wMS_CKPD) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <returns></returns>
        [HttpGet("GetCXWMS_CKPD")]
        public IActionResult GetCXWMS_CKPD(int PageNumber, int PageSize)
        {
            FYCXWMS_CKPD fYCXWMS_CKPD = wMS_CKPDRepository.GetCXWMS_CKPD(PageNumber, PageSize);
            return Ok(fYCXWMS_CKPD);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateWMS_CKPD")]
        public IActionResult UpdateWMS_CKPD(XGWMS_CKPD wMS_CKPD)
        {
            bool rs = wMS_CKPDRepository.UpdateWMS_CKPD(wMS_CKPD) > 0;
            return Ok(rs);
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        [HttpPut("UpdateWMS_CKPDSL")]
        public IActionResult UpdateWMS_CKPDSL(int uid,decimal sl,string code)
        {
            bool rs = wMS_CKPDRepository.UpdateWMS_CKPDSL(uid,sl,code) > 0;
            return Ok(rs);
        }
    }
}
